package com.gitee.kenewstar.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author kenewstar
 * @date 2021/6/9
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class VcuResult {
    private int code;
    private String msg;
    private Object data;

    public VcuResult(Object data) {
        this(200, "ok", data);
    }

    public static VcuResult build(Object data) {
        return new VcuResult(data);
    }

    public static VcuResult success(Object data) {
        return build(data);
    }
    public static VcuResult success() {
        return success(null);
    }

    public static VcuResult failed(String msg) {
        return new VcuResult(400, msg, null);
    }
    public static VcuResult failed() {
        return failed("error");
    }
}
